From: Owen W. Taylor Date: Sat, 2 Apr 2011 19:05:06 +0000 (-0400) Subject: network: fix logic bug in checking whether to activate or deactive X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~8393 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=6c3300bc2f196c76b17ccd78804a9f2aabaff48e;p=gnome-shell.git network: fix logic bug in checking whether to activate or deactive A cosmetic change recommended in review of the patch to fix the VPN Connections switch ended up introducing a logic error that made the switch not work properly. Fix. https://bugzilla.gnome.org/show_bug.cgi?id=646380 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 7616542c8..c78b08b03 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -254,12 +254,14 @@ NMWiredSectionTitleMenuItem.prototype = { return; } + let newState = this._switch.state; + // Immediately reset the switch to false, it will be updated appropriately // by state-changed signals in devices (but fixes the VPN not being in sync // if the ActiveConnection object is never seen by libnm-glib) this._switch.setToggleState(false); - if (this._switch.state) + if (newState) this._device.activate(); else this._device.deactivate();